﻿namespace EkStudio.com.common.unit
{
    public static class ProjectUtil
    {

        public const string PROJECT_NAME = "EkStudio";

        public const string PROJECT_SHORT_NAME = "EkStudio";

        


        /// <summary>
        /// sesssion中用户的key
        /// </summary>
        public const string SESSION_USER_ID = "USER_KEY";

        //帐套目录
        //------------------------模块目录------------------------------------
        /// <summary>模块目录//单据目录</summary>
        public const string BILLPATH = "Config/Module/GSBill/";
        /// <summary>模块目录//字典目录</summary>
        public const string DICTPATH = "Config/Module/GSDictionary/";
        /// <summary>模块目录//系统单据目录 </summary>
        public const string SYSBILLPATH = "Config/Module/GSSystemBill/";
        /// <summary>模块目录//系统表目录 </summary>
        public const string SYSTABLEPATH = "Config/Module/GSSystemTable/";
        /// <summary>模块目录//多样式表单目录 </summary>
        public const string BILL_MULTIPLE_PATH = "Config/Module/KTMultipleBill/";
        /// <summary>模块目录//图形统计表单目录 </summary>
        public const string BILL_CHART_PATH = "Config/Module/KTChartBarBill/";
        /// <summary>模块目录//库存映射 </summary>
        public const string BILL_MAP_PATH = "Config/Module/MapBill/";
        //------------------------系统目录------------------------------------
        /// <summary>附件存放目录 </summary>
        public const string ATTACHMENT = "Config/System/Attachment/";

        /// <summary>模块Menu文件 </summary>
        public const string PROJECTMENU = "Config/System/ProjectInfo/ProjectMenu.xml";
        /// <summary>模块配置文件 </summary>
        public const string PROJECTVERSION = "Config/System/ProjectInfo/ProjectVersion.xml";

        public const string PROJECTREFLECT = "Config/System/ProjectInfo/ProjectReflectCfg.xml";

        /// <summary>工作流配置文件 </summary>
        public const string WORKFLOWPATH = "Config/System/WorkFlow/";

        //--------------------------------HTTP链接配置参数-----------------------------------



        /// <summary>登录验证地址</summary>
        public const string HTTP_LOGINURL = "/HttpServletLogin.action";

        /// <summary>HTTP资源定位器地址</summary>
        public const string HTTP_RESOURCES_URL = "/HttpConnectResponse.action";

        /// <summary>
        /// HTTP帐套系统注销登录
        /// </summary>
        public const string HTTP_LOGINOUT_URL = "/HttpServletLoginOut.action";

        /// <summary>HTTP帐套保存地址</summary>
        public const string HTTP_SAVEXML_URL = "/HttpServletSaveXML.action";

        /// <summary>HTTP帐套安全控制地址</summary>
        public const string HTTP_SAFETY_URL = "/HttpServletModManage.action";//safety

        /// <summary>HTTP帐套编译控制地址  </summary>
        public const string HTTP_COMPILE_URL = "/HttpServletCompile.action";
        /// <summary>HTTP帐套服务器控制台输出  </summary>
        public const string HTTP_CONSOLE_URL = "/HttpServletConsole.action";
        /// <summary>HTTP判定帐套文件类存在地址  </summary>
        public const string HTTP_FILEEXIST_URL = "/HttpServletExistFile.action";
        /// <summary>HTTP帐套文件下载地址  </summary>
        public const string HTTP_FILELOAD_URL = "/HttpServletLoadFile.action";
        /// <summary>HTTP帐套文件上传地址 </summary>
        public const string HTTP_FILEUPLOAD_URL = "/HttpServletUploadFile.action";
        /// <summary>HTTP帐套多语言下载地址 </summary>
        public const string HTTP_LGELOAD_URL = "/HttpServletLgeLoadFile.action";
        /// <summary>HTTP帐套多语言上传地址 </summary>
        public const string HTTP_LGEUPLOAD_URL = "/HttpServletLgeUploadFile.action";
        /// <summary> HTTP帐套附件列表 </summary>
        public const string HTTP_ATTACH_LIST_URL = "/HttpServletAttachList.action";
        /// <summary> HTTP删除帐套附件文件 </summary>
        public const string HTTP_ATTACH_DELETE_URL = "/HttpServletDeleteFile.action";
        /// <summary>
        /// HTTP目录列表排序管理
        /// </summary>
        public const string HTTP_MENUMAP_URL = "/HttpServletMenuMap.action";

        /// <summary>
        /// HTTP查询帐户允许登录状态
        /// </summary>
        public const string HTTP_ALLOW_LOGIN_URL = "/HttpServletAllowLogin.action";


        /// <summary>字典类型</summary>
        public const int TYPE_DIC_MODULE = 1;
        /// <summary>模块类型</summary>
        public const int TYPE_BILL_MODULE = 2;
        /// <summary>模块分组根类型</summary>
        public const int TYPE_BILL_MODULE_ROOT = 3;
        /// <summary> 多样式表单类型</summary>
        public const int TYPE_BILL_MULTIPLE = 4;
        /// <summary>工作流表单类型</summary>
        public const int TYPE_BILL_WORKFLOW = 5;
        /// <summary>图形统计表单类型</summary>
        public const int TYPE_BILL_CHARTBAR = 6;
        /// <summary>帐套表单</summary>
        public const int TYPE_PROJECT_MENU = 7;
        /// <summary>工程表单</summary>
        public const int TYPE_PROJECT_VERSION = 8;
        /// <summary>数据映射</summary>
        public const int TYPE_BILL_DATAMAP = 9;
        /// <summary>数据反射</summary>
        public const int TYPE_BILL_REFLECT = 10;

        /// <summary>
        /// 字典根
        /// </summary>
        public const int TYPE_DIC_MODULE_ROOT    = 20;
        /// <summary>
        /// 模块分组
        /// </summary>
        public const int TYPE_BILL_MODULE_GROUP  = 21;
        /// <summary>
        /// 多样式表单根
        /// </summary>
        public const int TYPE_BILL_MULTIPLE_ROOT = 22;
        /// <summary>
        /// 工作流根节点
        /// </summary>
        public const int TYPE_BILL_WORKFLOW_ROOT = 23;
        /// <summary>
        /// 统计图形根节点
        /// </summary>
        public const int TYPE_BILL_CHARTBAR_ROOT = 24;
        /// <summary>库存数据关系</summary>
        public const int TYPE_BILL_DATAMAP_ROOT = 25;


        public static string ICON_LAST_SELECTED_PATH = "";

        //****************表单控制命令****************************************

        /// <summary>新建表单</summary>
        public const string SAFETY_OPERATE_NEW = "new";
        /// <summary>删除表单</summary>
        public const string SAFETY_OPERATE_DELETE = "delete";
        /// <summary>关闭占用表单</summary>
        public const string SAFETY_OPERATE_CLOSE = "close";




        /// <summary>
        /// 获取各类型表单的帐套路径
        /// </summary>
        /// <param name="FileName"></param>
        /// <param name="FileType"></param>
        /// <returns>帐套路径</returns>
        public static string getBillPath(string FileName, int FileType)
        {
            string path = "";
            if (FileType == TYPE_BILL_MODULE)
            { //链接单据
                path = BILLPATH + FileName;
            }
            else if (FileType == TYPE_DIC_MODULE)
            { //链接字典
                path = DICTPATH + FileName;
            }
            else if (FileType == TYPE_BILL_MULTIPLE)//多样式表单
            {
                path = BILL_MULTIPLE_PATH + FileName;
            }
            else if (FileType == TYPE_PROJECT_MENU)//目录
            {
                path = PROJECTMENU;
            }
            else if (FileType == TYPE_PROJECT_VERSION)//版本控制
            {
                path = PROJECTVERSION;
            }
            else if (FileType == TYPE_BILL_WORKFLOW)//工作流
            {
                path = WORKFLOWPATH + FileName;
            }
            else if (FileType == TYPE_BILL_CHARTBAR)//统计
            {
                path = BILL_CHART_PATH + FileName;
            }
            else if(FileType == TYPE_BILL_DATAMAP)//库存
            {
                path = BILL_MAP_PATH + FileName;
            }
            else if(FileType == TYPE_BILL_REFLECT)//数据反射
            {
                path = PROJECTREFLECT;
            }
            return path;
        }
    }
}
